<template>
  <BaseDialog
    ref="baseDialog"
    width="300px"
    title="发货信息"
    @confrim="confrim"
  >
    <div>
      <div>
        <el-input
          v-model="id"
          class="item"
          disabled
          placeholder="ID"
        ></el-input>
        <el-input v-model="no" class="item" placeholder="物流单号"></el-input>
        <el-input
          v-model="company"
          class="item"
          placeholder="物流公司"
        ></el-input>
      </div>
    </div>
  </BaseDialog>
</template>

<script>
import { Message } from "element-ui";
import { publish } from "@/api/es";
export default {
  data() {
    return {
      company: "",
      id: "",
      no: "",
    };
  },
  methods: {
    open(data) {
      this.$refs.baseDialog.open();
      this.id = data.id
    },

    async confrim() {
      this.$emit("confrim", this.dot);
      const res = await publish({
        id: this.id,
        company: this.company,
        no: this.no,
      });
      if (!res.status) {
        this.close();
        Message.success("发货成功");
        this.$emit('success')
      }
    },
    close() {
      this.$refs.baseDialog.close();
    },
  },
};
</script>

<style scoped>
.item {
  margin-bottom: 5px;
}
</style>
